<%@page import="java.text.DecimalFormatSymbols"%>
<%@page import="java.text.DecimalFormat"%>
<%@page import="dataEntity.City"%>
    
<%@ page language="java" pageEncoding="utf-8" contentType="text/html;charset=utf-8" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
		<title>Show Cities by Population</title>
	</head>
	<body>
		<%@ page language="java" import="java.util.*" %>
		<%List<City> lCity = (List<City>)session.getAttribute("cities"); 
			int i = 1;
			
			out.print("<table border=\"1\">");
			out.println("<TR>");
			out.println("<TD><B> CITY NAME </B> </TD> <TD><B> POPULATION </B></TD>");
			out.println("</TR>");
			DecimalFormat df = new DecimalFormat();
			DecimalFormatSymbols dfs = new DecimalFormatSymbols();
			dfs.setGroupingSeparator('.');
			
			df.setDecimalFormatSymbols(dfs);
			for (City city: lCity) {
				out.println("<TR>");
				out.println("<TD>"+city.getName()  +"</TD> <TD>" + df.format(city.getPopulation())+  "</TD>");
				out.println("</TR>");
			}
		%>	
	</body>
</html>